<!DOCTYPE HTML>
<html lang="en" >
    <!-- Start book 我的电子书 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>盒子模型 | 我的电子书</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.9">
        <meta name="author" content="Melon">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-image-captions/image-captions.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../md/01html/nvmgitbook.html" />
    
    
    <link rel="prev" href="../../md/01html/01label.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="1.1"
        data-chapter-title="盒子模型"
        data-filepath="md/01html/boxmodel.md"
        data-basepath="../.."
        data-revision="Mon Jun 08 2020 19:44:34 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/01html/01label.html">
            
                
                    <a href="../../md/01html/01label.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML标签
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.1" data-path="md/01html/boxmodel.html">
            
                
                    <a href="../../md/01html/boxmodel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        盒子模型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="md/01html/nvmgitbook.html">
            
                
                    <a href="../../md/01html/nvmgitbook.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        nvm和gitbook
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="md/02css/index.html">
            
                
                    <a href="../../md/02css/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="md/02css/01selector.html">
            
                
                    <a href="../../md/02css/01selector.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="md/02css/element_center.html">
            
                
                    <a href="../../md/02css/element_center.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        元素垂直居中的方法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="md/02css/Interview.html">
            
                
                    <a href="../../md/02css/Interview.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        面试题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="md/02css/displayvisibility.html">
            
                
                    <a href="../../md/02css/displayvisibility.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        元素的显示模式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="md/02css/float.html">
            
                
                    <a href="../../md/02css/float.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="md/02css/media.html">
            
                
                    <a href="../../md/02css/media.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        media媒体查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="md/02css/position.html">
            
                
                    <a href="../../md/02css/position.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="md/02css/textoverflow.html">
            
                
                    <a href="../../md/02css/textoverflow.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        文本溢出处理
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >我的电子书</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x76D2;&#x5B50;&#x6A21;&#x578B;">&#x76D2;&#x5B50;&#x6A21;&#x578B;</h1>
<ul>
<li>&#x5185;&#x5BB9;&#xFF1A;<code>content</code>+<code>padding</code>+<code>border</code>+<code>margin</code></li>
</ul>
<h4 id="&#x6CE8;&#x610F;&#xFF1A;&#x4F7F;&#x7528;margin&#x5B9A;&#x4E49;&#x5757;&#x5143;&#x7D20;&#x7684;&#x5782;&#x76F4;&#x5916;&#x8FB9;&#x8DDD;&#x65F6;&#x5019;&#xFF0C;&#x53EF;&#x80FD;&#x51FA;&#x73B0;&#x5916;&#x8FB9;&#x8DDD;&#x5408;&#x5E76;">&#x6CE8;&#x610F;&#xFF1A;&#x4F7F;&#x7528;margin&#x5B9A;&#x4E49;&#x5757;&#x5143;&#x7D20;&#x7684;&#x5782;&#x76F4;&#x5916;&#x8FB9;&#x8DDD;&#x65F6;&#x5019;&#xFF0C;&#x53EF;&#x80FD;&#x51FA;&#x73B0;&#x5916;&#x8FB9;&#x8DDD;&#x5408;&#x5E76;</h4>
<h3 id="1-&#x76F8;&#x90BB;&#x5143;&#x7D20;&#x5782;&#x76F4;&#x5916;&#x8FB9;&#x8DDD;&#x7684;&#x5408;&#x5E76;">1. &#x76F8;&#x90BB;&#x5143;&#x7D20;&#x5782;&#x76F4;&#x5916;&#x8FB9;&#x8DDD;&#x7684;&#x5408;&#x5E76;</h3>
<ul>
<li>&#x5F53;&#x76F8;&#x90BB;&#x5143;&#x7D20;&#x76F8;&#x9047;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x4E0A;&#x9762;&#x5143;&#x7D20;&#x7684;&#x4E0B;&#x8FB9;&#x8DDD;&#xFF0C;&#x4E0B;&#x9762;&#x5143;&#x7D20;&#x7684;&#x4E0A;&#x8FB9;&#x8DDD;&#xFF0C;&#x4ED6;&#x4EEC;&#x7684;&#x5782;&#x76F4;&#x95F4;&#x8DDD;&#x4E0D;&#x662F;&#x4E24;&#x4E2A;&#x4E4B;&#x548C;&#xFF0C;&#x53D6;&#x4E24;&#x4E2A;&#x503C;&#x5F53;&#x4E2D;&#x8F83;&#x5927;&#x7684;&#x4E00;&#x4E2A;<code>margin</code>&#x503C;&#x3002;</li>
<li>&#x89E3;&#x51B3;&#x65B9;&#x6848;&#xFF1A;&#x5C3D;&#x91CF;&#x53EA;&#x7ED9;&#x4E00;&#x4E2A;&#x76D2;&#x5B50;&#x6DFB;&#x52A0;margin&#x503C;</li>
</ul>
<h3 id="2-&#x5D4C;&#x5957;&#x5757;&#x5143;&#x7D20;&#x5782;&#x76F4;&#x5916;&#x8FB9;&#x8DDD;">2. &#x5D4C;&#x5957;&#x5757;&#x5143;&#x7D20;&#x5782;&#x76F4;&#x5916;&#x8FB9;&#x8DDD;</h3>
<ul>
<li>&#x5BF9;&#x4E8E;&#x4E24;&#x4E2A;&#x5D4C;&#x5957;&#x5173;&#x7CFB;&#x7684;&#x5757;&#x5143;&#x7D20;&#xFF0C;&#x7236;&#x5143;&#x7D20;&#x4E0A;&#x5916;&#x8FB9;&#x8DDD;&#x540C;&#x65F6;&#x5B50;&#x5143;&#x7D20;&#x4E5F;&#x6709;&#x5916;&#x8FB9;&#x8DDD;&#xFF0C;&#x8FD9;&#x65F6;&#x5019;&#x7236;&#x5143;&#x7D20;&#x9AD8;&#x5EA6;&#x5C31;&#x4F1A;&#x584C;&#x9677;</li>
<li>&#x89E3;&#x51B3;&#x65B9;&#x6848;&#xFF1A;<ol>
<li>&#x7236;&#x5143;&#x7D20;&#x6DFB;&#x52A0;overflow&#xFF1A;hidden </li>
<li>b.&#x7236;&#x5143;&#x7D20;&#x6DFB;&#x52A0;padding&#x503C; </li>
<li>c.&#x7236;&#x5143;&#x7D20;&#x6DFB;&#x52A0;border</li>
</ol>
</li>
</ul>
<h3 id="&#x76D2;&#x5B50;&#x6A21;&#x578B;&#x6709;&#x54EA;&#x4E9B;&#xFF1F;">&#x76D2;&#x5B50;&#x6A21;&#x578B;&#x6709;&#x54EA;&#x4E9B;&#xFF1F;</h3>
<ul>
<li>w3c&#x6807;&#x51C6;&#x76D2;&#x5B50;&#x6A21;&#x578B;</li>
<li>ie&#x76D2;&#x5B50;&#x6A21;&#x578B;</li>
</ul>
<h5 id="&#x901A;&#x8FC7;boxsizing&#x8BBE;&#x7F6E;">&#x901A;&#x8FC7;<code>box-sizing</code>&#x8BBE;&#x7F6E;</h5>
<ul>
<li><p>IE&#x76D2;&#x5B50;&#x6A21;&#x578B;</p>
<pre><code class="lang-css"><span class="hljs-rule"><span class="hljs-attribute">box-sizing</span>:<span class="hljs-value">border-box</span></span>;
</code></pre>
</li>
<li><p>W3C&#x76D2;&#x5B50;&#x6A21;&#x578B;</p>
<pre><code class="lang-css"><span class="hljs-rule"><span class="hljs-attribute">box-sizing</span>:<span class="hljs-value">content-box</span></span>;
</code></pre>
</li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../md/01html/01label.html" class="navigation navigation-prev " aria-label="Previous page: HTML标签"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../md/01html/nvmgitbook.html" class="navigation navigation-next " aria-label="Next page: nvm和gitbook"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"image-captions":{"attributes":{"style":"left: 50%;position: relative;transform: translateX(-50%);"},"caption":"图 _PAGE_LEVEL_._PAGE_IMAGE_NUMBER_ - _CAPTION_","align":"center","variable_name":"_pictures"},"fontsettings":{"theme":"night","family":"sans","size":2},"toggle-chapters":{},"highlight":{}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book 我的电子书 -->
</html>
